//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "arrays\fn_hashKeys.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>
#ifndef __DUMP_INDENT__
#define __DUMP_INDENT__	"    "
#endif

private ["_hash_array","_hash_key","_hash_indexer","_index","_hash_values","_result","_default"];
TRACE_1("Start",_this);
TMFPROFILERSTART;
_result = [];
If (typeName _this == typename []) then {
	if (count _this >= 1) then {
		DEFAULT_PARAM(_hash_array,0,(call CFUNC(hashEmpty)));
		if (typeName _hash_array == typename []) then {
			// Normally "== 2" is enough since a hash only needs a key indexer and a value array, but in the future we might extend it to more keys for multi dimensional storage
			//  So they 1st dimension keys array is always the first and the values container is always the last one
			if (count _hash_array >= 2) then {
				_result = _hash_array select 0;
			};				
		};
	};
};
TRACE_1("End",_result);
TMFPROFILERSTOP;
_result;
